home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / aeclipd.arc / AEDIAL.DOC < prev    next >
Text File  |  1989-10-14  |  7KB  |  187 lines

  1.                         Brought to You By:
  2. ────────────────────────────────────────────────────────────────────────────── 
  3.   ╔╦════╦╗ ╔╗    ╔╗ ╔╦═╦╦═╦╗ ╔╦════╦╗   ╔╦════╦╗ ╔╗    ╔╗ ╔╦════╦╗ ╔╦════╦╗
  4.   ║║    ║║ ║║    ║║ ╚╝ ║║ ╚╝ ║║    ║║   ║║    ╚╝ ╚╩╗  ╔╩╝ ║║    ╚╝ ║║    ╚╝
  5.   ║╠════╣║ ║║    ║║    ║║    ║║    ║║   ║╠═══╣    ╔╩══╩╗  ║╠═══╣   ║║
  6.   ║║    ║║ ║║    ║║    ║║    ║║    ║║   ║║    ╔╗ ╔╣    ╠╗ ║║    ╔╗ ║║    ╔╗
  7.   ╚╝    ╚╝ ╚╩════╩╝    ╚╝    ╚╩════╩╝   ╚╩════╩╝ ╚╝    ╚╝ ╚╩════╩╝ ╚╩════╩╝
  8. ──────────────────────────────────────────────────────────────────────────────
  9.      Auto Exec BBS      (508) 833-0508 & (508) 833-0509 - 300-19,200 HST
  10.  1 GIGABYTE On-Line    (508)833-0510 - MicroCom QX/V.32c, 300-38,400 V.32
  11.  « « « « « » » » » »    Only Reg Reqd to D/L up to 450,000 bytes per day
  12. ──────────────────────────────────────────────────────────────────────────────
  13.  SysOps: Milton Shaw & Gene Lafond      Home of AECLIP Clipper 'C' Libraries
  14. ──────────────────────────────────────────────────────────────────────────────
  15. Specializing in Clipper/dBASE/FoxBase, 'C', Pascal, Novell, Games, Adult & Mac
  16. ──────────────────────────────────────────────────────────────────────────────
  17.  
  18.  
  19.                                  AEDIAL.LIB
  20.  
  21.  
  22. Author:       Milton F. Shaw Jr.
  23. Copyright:    Auto Exec Inc., (c) Copyright 1989, ALL RIGHTS RESERVED
  24. Date:         October 12, 1989
  25. Purpose:      'C' Function to Dial Hayes Compatible Modem from Clipper S87
  26. Restrictions: None - Post Public Domain as long as files contained in ZIP
  27.               format and only the files listed below:
  28.  
  29.               AECLIPD.PRG - Linkable Program to test aedial.lib
  30.               AEDIAL.LIB  - Library of Functions
  31.               AEDIAL.C    - 'C' Source
  32.               AEDIAL.DOC  - This Document
  33.               AEDIAL.LST  - Map of OBJ
  34.               READIT.COM  - Auto Exec BBS Ad
  35.  
  36.  
  37. Why AEDIAL?
  38.  
  39. Just thought I'd show how I approach making 'C' functions work with Clipper
  40. since I am not a serious 'C' programmer.  This shows anyone can make 'C' 
  41. functions that will work with Clipper.  Any serious 'C' programmer would look
  42. at the code in agony. Oh Well!
  43.  
  44. Why 'C' Functions - Basically because Clipper, as good as it is, lacks special
  45. functions we often need.  Granted you can buy libraries that will give you
  46. most functions you could ever want.  Auto Exec has shareware libraries for
  47. the following:
  48.  
  49.         Graphics - Large Graphic library for Clipper   - AECLIPT.ZIP
  50.         Math     - 48 Mathematic functions for Clipper - AECLIPM.ZIP  
  51.         Indexes  - Convert NDX, IDX, MDX to NTX        - AECLIPI.ZIP
  52.         DOS      - Many DOS functions - MD, CD, RD etc - AECLIP.ZIP
  53.         STRINGS  - String Functions                    - AECLIPS.ZIP
  54.  
  55. But back to the subject at hand.  I wanted to provide a quick dialer for my
  56. clients programs - Well I could use SilverCom, or Clipper Tools One which
  57. I have both of.  Then I thought, how hard is it to write a simple little 'C'
  58. function to dial a modem.  
  59.  
  60. Time to get out the "Waite Groups MicroSoft C Bible" and "Microsoft C
  61. Programming for the IBM" - two excellent books put out by Howard Sams
  62. & Company.
  63.  
  64. A little investigation and you find that there are 'C' commands to address
  65. the comm ports. Great - now we've got it.
  66.  
  67. To make a 'C' function I generally look through my library of books, find
  68. working code for a program that does what I want, make it work in 'C', and
  69. then modify it for Clipper.  
  70.  
  71. How do you modify it.  Well basically the only thing you need to do is to 
  72. change the MAIN() procedure to CLIPPER <your function name>().  Keep the 
  73. function name 10 characters or less.
  74.  
  75. Now add to the include list:
  76.  
  77.     #include "EXTEND.H"
  78.  
  79. I use the QuickC compile command with a Syntax Check only to make sure I'm
  80. ok.  Then you need to save the code and complile it as a large model.  
  81. Microsoft 'C' compiling batch file would look like:
  82.  
  83. cl/c /AL /F 0x4000 /FPa /Gs /Zl /Oalt <your file>
  84.  
  85. This will produce the .OBJ for the .C program.  Now what I do is make it
  86. into a LIB by using the MicroSoft LIB.EXE program.  
  87.  
  88.     Example:  LIB AEDIAL
  89.  
  90. Now if AEDIAL.LIB does not exist - it will ask if I want to make it, sure
  91. we do.
  92.  
  93. Then it asks for an operation. 
  94.  
  95.    OPERATION: +aedial.obj
  96.  
  97. This adds aedial.obj to AEDIAL.LIB
  98.  
  99. Then it will ask for list file: Either enter a file name or hit enter.
  100. If you look at AEDIAL.LST - this is a list file of the LIB.
  101.  
  102. Now it asks for an OUTPUT LIB - I just hit enter.
  103.  
  104. You've made a library of your function - great, but if it calls any other
  105. routines you need to include them.  Generally I pull all the additional
  106. routines I need from LLIBCA.LIB.  
  107.  
  108. To see the functions in there do this:
  109.  
  110. LIB LLIBCA
  111. OPERATION: <hit enter>
  112. list File: LLIBCA.LST
  113. OUTPUT LIB: <hit enter>
  114.  
  115. this makes a list of all the functions in llibca.lib
  116.  
  117. now compile your program with any of the following linkers:
  118.  
  119. TLINK <your file>,,,CLIPPER+EXTEND+<YOUR LIB>
  120. PLINK86 FI <your file> LIB Clipper, Extend, <YOUR LIB>
  121.   or
  122. LINK /NOE <your file>,,,CLIPPER+EXTEND+<YOUR LIB>
  123.  
  124. A list of missing routines will appear.  Keep a list of them.
  125.  
  126. Now find them in the LLIBCA.LST - I use LIST64x program to do this.
  127. Identify the .OBJ they are in so you can extract them from LLIBCA.LIB.
  128.  
  129. Lets say we need int86.obj.  First we have to get it out of LLIBCA.LIB
  130.  
  131. so,
  132.  
  133. LIB LLIBCA
  134. Operations: *int86.obj
  135. list file: <enter>
  136. output lib: <enter>
  137.  
  138. LIB <YOUR LIB>
  139. Operations: +int86.obj
  140. list file: <enter>
  141. output lib: <enter>
  142.  
  143. now int86.obj is in your library.  Continue to find the missing resources
  144. you need - copy them from their original LIB (* command) and then add them
  145. to your LIB.  In the end you will have a stand-alone LIB.
  146.  
  147. Only a little confusing, actually not bad once you get the hang of it. If
  148. you don't care about the size of the LIB you could simply add LLIBCA.LIB to
  149. your LIB by:
  150.  
  151. LIB <YOUR LIB>
  152. operations: +llibca.lib
  153. list file: <enter>
  154. output lib: <enter>
  155.  
  156. Messy though, makes large LIBS
  157.  
  158.  
  159. Ok enough about 'C' and clipper LIB, etc.  Lets see what functions AEDIAL
  160. has.
  161.  
  162.  
  163.  
  164. ModemNum(comport), where 0 = COM 1, 1 = COM 2.  Default is COM 1
  165.  
  166. ModemInit(baud), where baud = 110, 300, 1200, 2400, 9600
  167.  
  168. ModemStr(string), where string = command for AT, i.e.
  169.         ModemStr("H0") - HangUp
  170.         ModemStr("V1 X7 Q0 F1 E1 &W") - Good initialization string
  171.  
  172. ModemDial(string), where the string is the phone number, i.e.,
  173.         ModemDial("1-508-833-0508")
  174.  
  175. ModemStat(), returns modem status in verbal mode if V1 command issued
  176.              with ModemStr() function. Returns a string
  177.  
  178.  
  179. Well I guess I've been long winded enough, play with it, look at the 'C' 
  180. source and demo program AECLIPD.PRG.  Hopefully this will help you make
  181. some Clipper 'C' UDF's for the public domain.  If you do please upload 
  182. them to Auto Exec BBS, we're trying to maintain the largest Clipper
  183. file list around.  If you do call - let me know how AEDIAL worked for you 
  184. or any suggestions on improvement.
  185.  
  186.  
  187.